package com.lcredu.seckill.util.response;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @author 黎长容
 * @date 2025-08-23 18:35
 */
@Getter
@AllArgsConstructor
@ToString
public enum RespBeanEnum {
    //通用
    SUCCESS(200, "SUCCESS"),
    ERROR(500, "服务器错误"),

    /**
     * 登录模块
     * 1.手机号格式错误
     * 2.手机号不存在
     * 3.用户名或密码错误
     */
    LOGIN_ERROR(50010, "用户名或密码错误"),
    MOBILE_NOT_EXISTS(50100, "手机号不存在"),
    MOBILE_NO_MATCH(50110, "手机号格式错误"),
    BING_ERROR(50111, "参数校验错误"),
    PASSWORD_UPDATE_FAIL(50112, "密码更新失败"),

    /**
     * 秒杀模块
     * 1. 库存不足
     * 2. 超购
     * 3. 秒杀失败
     * 4. 非法请求
     * 5. 用户信息有误
     * 6. 排队中
     */
    STOCK_NOT_ENOUGH(50500, "库存不足"),
    REPEAT_SECKILL(50510, "不能重复秒杀"),
    SECKILL_ERROR(50520, "秒杀失败"),
    REQUEST_ILLEGAL(50521, "非法请求"),
    SESSION_ERROR(500522, "用户信息错误"),
    SEC_KILL_WAIT(500523, "排队中...."),
    CAPTCHA_ERROR(500524, "校验码错误"),
    REPEAT_CLICK(50530, "请勿频繁点击");

    private final Integer code;
    private final String message;
}
